package priv.yiyuan.example.design.chain.command01;

/**
 * 查询处理器
 * <p>
 * 具体处理者
 *
 * @author YiYuan
 * @data 2025/10/9
 * @apoNote
 */
public class QueryHandler extends AccountHandler {

    @Override
    public void handle(Command command, Account account) {

        if (command instanceof QueryBalanceCommand) {
            command.execute(account);
        }
        else if (nextHandler != null) {
            nextHandler.handle(command, account);
        }
    }
}
